import React from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import * as addressActions from '../../actions/address'


export function connectAddress(Component) {
	class WrapComp extends React.Component {
		render() {
			return (
				<div><Component {...this.props} /></div>
			);
		}
	}
	 const mapStateToProps = (state) => ({
   		address: {
   			addressData: state.address.addressData,
			isFetched: state.address.isFetched,
			isAdded: state.address.isAdded,
			isDeled: state.address.isDeled,
			isEdited: state.address.isEdited,
			isSeted: state.address.isSeted,
   		}
  	});
  	const mapDispatchToProps = (dispatch) => ({
		addressActions: bindActionCreators(addressActions, dispatch),
  	});
	return connect(mapStateToProps, mapDispatchToProps)(WrapComp);
}